<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:50:"E:\WWW\waimai/app/wechat/cart\view\cart\index.html";i:1502696518;s:53:"E:\WWW\waimai/app/wechat/cart\view\template\base.html";i:1502093285;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>外卖</title>
    <link rel="stylesheet" href="__STATIC__/css/mui.min.css">
    <link rel="stylesheet" href="__STATIC__/css/ks.css">
    
    <script>
        var require_path = "__STATIC__/app";
    </script>
    <script src="__STATIC__/app/require.js"></script>
    <script src="__STATIC__/app/require.config.js"></script>
    <script src="__STATIC__/app/plugin/jquery-3.2.1.min.js"></script>
    <script src="__STATIC__/app/plugin/mui/mui.min.js"></script>
    
</head>
<body>



<body>
<header class="header">
    <div>
        <a class="back" href="<?php echo url('shop/shop/index'); ?>"><i class="iconfont icon-zuoyoujiantou-copy-copy-copy"></i></a>
        购物车
    </div>
</header>
<div class="pages" id="cart_page">
    <?php if(!empty($list)): ?>
    <div class="list-form other">
        <?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
        <ul id="ul_<?php echo $vo['id']; ?>">
            <li>
                <?php if($vo['enable']==1): ?>
                <div class="checkbox-view absmiddle-left">
                    <input type="checkbox" name="all_check"  <?php if($vo['check']==true): ?> checked="true" <?php endif; ?>  @change="all_check(<?php echo $vo['id']; ?>)" >
                </div>
                <?php endif; ?>
                <div>
                    <div class="edit-title"><?php echo $vo['name']; ?></div>

                    <span class="edit" @tap.stop="edit(<?php echo $vo['id']; ?>,<?php echo $vo['total_price']; ?>,<?php echo $total_price; ?>)">编辑</span>

                </div>
            </li>
            <li class="goods-list">
                <ul id="<?php echo $vo['id']; ?>">
                    <?php if(is_array($vo['items']) || $vo['items'] instanceof \think\Collection || $vo['items'] instanceof \think\Paginator): $i = 0; $__LIST__ = $vo['items'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($i % 2 );++$i;?>
                    <li id="li_<?php echo $item['cart_id']; ?>">
                        <?php if($item['enable']==1): ?>
                        <div class="checkbox-view absmiddle-left">
                            <input type="checkbox"  name="checkbox"   <?php if($item['flag_choose']==1): ?> checked="true" <?php endif; ?>  @change="check(<?php echo $item['cart_id']; ?>,<?php echo $vo['id']; ?>,<?php echo $item['price']; ?>,<?php echo $item['id']; ?>)" value="<?php echo $item['cart_id']; ?>">
                        </div>
                        <?php endif; ?>
                        <div class="img"><img src="<?php echo $item['cover_image']; ?>" height="441" width="500"/></div>
                        <div class="text">
                            <div class="title"><?php echo $item['name']; ?></div>
                            <p>

                                <?php if($item['enable']==0): ?>
                                    <span class="color-primary">此商品已下架</span>
                                <?php else: ?>
                                x<span><?php echo $item['num']; ?></span>
                                <?php endif; ?>

                                <span class="pull-right color-primary">￥<?php echo $item['price']; ?></span>
                            </p>
                        </div>
                        <div class="hidden">
                            <div class="box">
                                <?php if($item['enable']==1): ?>
                                <div class="l">
                                    <div class="calc">
                                        <span @tap.stop="down_tap(<?php echo $vo['id']; ?>,<?php echo $item['price']; ?>,<?php echo $item['id']; ?>,<?php echo $item['cart_variant_id']; ?>,<?php echo $item['cart_id']; ?>)" class="down"><i
                                                class="iconfont icon-wuuiconsuoxiao"></i></span>
                                        <input type="tel" readonly class="num" value="<?php echo $item['num']; ?>" maxlength="3">
                                        <span @tap.stop="up_tap(<?php echo $vo['id']; ?>,<?php echo $item['price']; ?>,<?php echo $item['id']; ?>,<?php echo $item['cart_variant_id']; ?>,<?php echo $item['cart_id']; ?>)" class="up"><i
                                                class="iconfont icon-wuuiconxiangjifangda"></i></span>
                                    </div>
                                </div>
                                <?php endif; ?>
                                <div class="r">
                                    <a @tap.stop="del_btn(<?php echo $vo['id']; ?>,<?php echo $item['id']; ?>,<?php echo $item['price']; ?>,<?php echo $item['cart_id']; ?>)"
                                       class="delete">删除</a>
                                </div>
                            </div>
                        </div>
                    </li>
                    <?php endforeach; endif; else: echo "" ;endif; ?>
                </ul>
            </li>
            <li>小计：￥<span id="span_<?php echo $vo['id']; ?>" class="color-primary total_prcie_span"><?php echo $vo['total_price']; ?></span></li>
        </ul>
        <?php endforeach; endif; else: echo "" ;endif; ?>
    </div>
    <div class="foot-btn">
        <div>
            <i  class="iconfont icon-gouwuche"></i>
            <span id="total_price"><?php echo $total_price; ?></span>元
            <a @tap="send_btn()" id="send_btn" class="btn">去结算</a>
        </div>
    </div>
    <?php else: ?>
    <div class="tip-icon" >
        <i class="iconfont icon-gouwuchekong"></i>
        <p>空空如也</p>
    </div>
    <?php endif; ?>
</div>


</body>
<script>
    if(document.querySelector('.goback')!=null){
        document.querySelector('.goback').addEventListener('tap', function () {
            history.back();
        })
    }

</script>

<script>
    var list_url = "<?php echo url('shop/Goods/detail'); ?>";
    var add_cart_url = "<?php echo url('cart/Cart/add_cart'); ?>";
    var send_order_url = "<?php echo url('order/Order/send_order'); ?>";
    var delete_cart_item_url = "<?php echo url('cart/Cart/delete'); ?>";
    var check_url = "<?php echo url('cart/Cart/check'); ?>";
    var un_check_url = "<?php echo url('cart/Cart/un_check'); ?>";
    var buy = "<?php echo $buy; ?>";
    if(buy!=="0"){
        buy = buy.split(",");
    }
    else {
        buy = [];
    }
    require(['cart/index']);
</script>

</html>